package com.ruoyi.web.core.config;



import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.ruoyi.common.config.Global;

/**
 * 资源映射路径
 */
@Configuration
public class MyWebAppConfigurer implements WebMvcConfigurer {

    /**上传地址*/
//    private static String filePath=Global.getUploadFolder();
    /**显示相对地址*/
//    private static String fileRelativePath=Global.getFileRelativePath();

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(Global.getFileRelativePath()).
                addResourceLocations("file:/" + Global.getUploadFolder());
    }
}

